<?php
session_start();
$admin_name=$_POST['admin_name'];
$admin_pass=$_POST['admin_pass'];
require_once '../inc/config.inc.php';

$sql = "SELECT admin_name, admin_pass"
      ." From admin"
      ." Where admin_name = '".$admin_name."'"
      ." And admin_pass = '".$admin_pass."'";
$table = mysql_query($sql) or die(mysql_error());
$num = mysql_num_rows($table);
$row = mysql_fetch_array($table);
if($num > 0)
{
    $_SESSION['admin_name'] = $row['admin_name'];
    $_SESSION['admin_pass'] = $row['admin_pass'];
    echo"<meta http-equiv='refresh' content='0;URL=../admin/other.php'>";
}
else {
    if($admin_name!=$row['admin_name'] && $admin_pass!=$row['admin_pass'])
        echo "<meta http-equiv='refresh' content='0;URL=../login/no_loginadmin.php'>";
        exit;
}
?>

